package com.liveinstars.api.post.dto;

import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * Base Comment param.
 *
 * @author johnniang
 * @author ryanwang
 * @date 2019-03-22
 */
@Data
public abstract class BaseCommentParam  {

    @Size(max = 50, message = "评论者昵称的字符长度不能超过 {max}")
    private String author;

    @Email(message = "邮箱格式不正确")
    @Size(max = 255, message = "邮箱的字符长度不能超过 {max}")
    private String email;

    @URL(message = "博客链接格式不正确")
    private String authorUrl;

    @NotBlank(message = "评论内容不能为空")
    @Size(max = 1023, message = "评论内容的字符长度不能超过 {max}")
    private String content;

    @Min(value = 1, message = "Post id must not be less than {value}")
    private Integer postId;

    @Min(value = 1, message = "user not less than 0")
    private Integer userId;

    private Long parentId = 0L;

    private Boolean allowNotification = true;


}
